package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.user.UserInfoBO;
import com.ymk.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-07-29
 */
@Service
public class UserInfoService implements IUserInfoService {

    @Override
    public UserInfoBO get(Map param) {
    return this.daoRouter.queryForObject("UserInfo.loadUserInfo",param);
    }

    @Override
    public List<UserInfoBO> list(Map param) {
        return this.daoRouter.query("UserInfo.loadUserInfo",param);
    }

    @Override
    public List<UserInfoBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("UserInfo.loadUserInfoForPage",pagination);
    }

    @Override
    public void post(UserInfoBO param) {
        this.daoRouter.insert("AUserInfo.insertUserInfo",param);
    }

    @Override
    public void update(UserInfoBO param) {
        this.daoRouter.update("AUserInfo.updateUserInfo",param);
    }

    @Override
    public void del(UserInfoBO param) {
        this.daoRouter.update("AUserInfo.delUserInfo",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
